//
// CAnimationSet.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRefCount;
import org.ryzom.nel.misc.IStream;

public class CAnimationSet extends CRefCount {
  private long swigCPtr;

  public CAnimationSet(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CAnimationSet_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CAnimationSet obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CAnimationSet(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CAnimationSet(boolean headerOptim) {
    this(nel3dJNI.new_CAnimationSet__SWIG_0(headerOptim), true);
  }

  public CAnimationSet() {
    this(nel3dJNI.new_CAnimationSet__SWIG_1(), true);
  }

  public long getNumChannelId() {
    return nel3dJNI.CAnimationSet_getNumChannelId(swigCPtr, this);
  }

  public String getChannelName(long channelId) {
    return nel3dJNI.CAnimationSet_getChannelName(swigCPtr, this, channelId);
  }

  public long getChannelIdByName(String name) {
    return nel3dJNI.CAnimationSet_getChannelIdByName(swigCPtr, this, name);
  }

  public long getAnimationIdByName(String name) {
    return nel3dJNI.CAnimationSet_getAnimationIdByName(swigCPtr, this, name);
  }

  public long getNumAnimation() {
    return nel3dJNI.CAnimationSet_getNumAnimation(swigCPtr, this);
  }

  public String getAnimationName(long animationId) {
    return nel3dJNI.CAnimationSet_getAnimationName(swigCPtr, this, animationId);
  }

  public CAnimation getAnimation(long animationId) {
    long cPtr = nel3dJNI.CAnimationSet_getAnimation__SWIG_0(swigCPtr, this, animationId);
    return (cPtr == 0) ? null : new CAnimation(cPtr, false);
  }

  public long getNumSkeletonWeight() {
    return nel3dJNI.CAnimationSet_getNumSkeletonWeight(swigCPtr, this);
  }

  public long getSkeletonWeightIdByName(String name) {
    return nel3dJNI.CAnimationSet_getSkeletonWeightIdByName(swigCPtr, this, name);
  }

  public String getSkeletonWeightName(long skeletonId) {
    return nel3dJNI.CAnimationSet_getSkeletonWeightName(swigCPtr, this, skeletonId);
  }

  public CSkeletonWeight getSkeletonWeight(long skeletonId) {
    long cPtr = nel3dJNI.CAnimationSet_getSkeletonWeight__SWIG_0(swigCPtr, this, skeletonId);
    return (cPtr == 0) ? null : new CSkeletonWeight(cPtr, false);
  }

  public long addAnimation(String name, CAnimation animation) {
    return nel3dJNI.CAnimationSet_addAnimation(swigCPtr, this, name, CAnimation.getCPtr(animation), animation);
  }

  public long addSkeletonWeight(String name, CSkeletonWeight skeletonWeight) {
    return nel3dJNI.CAnimationSet_addSkeletonWeight(swigCPtr, this, name, CSkeletonWeight.getCPtr(skeletonWeight), skeletonWeight);
  }

  public void reset() {
    nel3dJNI.CAnimationSet_reset(swigCPtr, this);
  }

  public void build() {
    nel3dJNI.CAnimationSet_build(swigCPtr, this);
  }

  public void serial(IStream f) {
    nel3dJNI.CAnimationSet_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public boolean loadFromFiles(String path, boolean recurse, String ext, boolean wantWarningMessage) {
    return nel3dJNI.CAnimationSet_loadFromFiles__SWIG_0(swigCPtr, this, path, recurse, ext, wantWarningMessage);
  }

  public boolean loadFromFiles(String path, boolean recurse, String ext) {
    return nel3dJNI.CAnimationSet_loadFromFiles__SWIG_1(swigCPtr, this, path, recurse, ext);
  }

  public boolean loadFromFiles(String path, boolean recurse) {
    return nel3dJNI.CAnimationSet_loadFromFiles__SWIG_2(swigCPtr, this, path, recurse);
  }

  public boolean loadFromFiles(String path) {
    return nel3dJNI.CAnimationSet_loadFromFiles__SWIG_3(swigCPtr, this, path);
  }

  public void setAnimationSampleDivisor(long sampleDivisor) {
    nel3dJNI.CAnimationSet_setAnimationSampleDivisor(swigCPtr, this, sampleDivisor);
  }

  public long getAnimationSampleDivisor() {
    return nel3dJNI.CAnimationSet_getAnimationSampleDivisor(swigCPtr, this);
  }

  public boolean isAnimHeaderOptimized() {
    return nel3dJNI.CAnimationSet_isAnimHeaderOptimized(swigCPtr, this);
  }

  public void preloadSSSShapes(IDriver drv, CShapeBank shapeBank) {
    nel3dJNI.CAnimationSet_preloadSSSShapes(swigCPtr, this, IDriver.getCPtr(drv), drv, CShapeBank.getCPtr(shapeBank), shapeBank);
  }

  public final static int NotFound = nel3dJNI.CAnimationSet_NotFound_get();

}
